package com.itheima.handler;


import com.itheima.vo.ResultInfo;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
@ResponseBody
public class CommonExceptionHandler {

    @ExceptionHandler(Exception.class)
    public ResultInfo ex(Exception e) {
        e.printStackTrace();

        return ResultInfo.error("网络异常，请稍后再试....");
    }
}
